package com.hg.chapter3.schedule;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

@Service
public class ScheduleService {

    //每秒执行一次
    @Scheduled(fixedRate = 1000)
    public void sayHi(){
        System.out.println("Hi");
    }

    //每天的11点28分执行
    @Scheduled(cron = "0 28 11 ? * *")
    public void sayHello(){
        System.out.println("Hello");
    }

}
